#!/bin/bash
{
  echo "System Information"
  uname -a
  echo "\nOperating System Release"
  cat /etc/os-release
  echo "\nCPU Information"
  lscpu
  echo "\nMemory Usage"
  free -h
  echo "\nDisk Usage"
  df -h
  echo "\nProcess List"
  ps aux
  echo "\nNetwork Interfaces"
  ip addr show
  echo "\nListening Ports"
  netstat -tuln
} > system_and_network_state_$(date +%Y%m%d_%H%M%S).txt